package com.shop.loan.model.view;

import com.shop.loan.handler.WithdrawApplyHandler;
import com.shop.loan.model.vo.WithdrawApplyVo;
import com.shop.loan.proxy.RentalPayWithdrawApplyLogProxy;
import lombok.Getter;
import lombok.Setter;
import xyz.erupt.annotation.Erupt;
import xyz.erupt.annotation.EruptField;
import xyz.erupt.annotation.sub_erupt.Power;
import xyz.erupt.annotation.sub_erupt.RowOperation;
import xyz.erupt.annotation.sub_field.Edit;
import xyz.erupt.annotation.sub_field.EditType;
import xyz.erupt.annotation.sub_field.View;
import xyz.erupt.annotation.sub_field.sub_edit.ChoiceType;
import xyz.erupt.annotation.sub_field.sub_edit.DateType;
import xyz.erupt.annotation.sub_field.sub_edit.Search;
import xyz.erupt.annotation.sub_field.sub_edit.VL;
import xyz.erupt.jpa.model.BaseModel;

import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.math.BigDecimal;
import java.util.Date;

@Setter
@Getter
@Entity
@Table(name = "s_order_day_s")
@Erupt(
        name = "提现申请",
        orderBy = "id desc",
        dataProxy = RentalPayWithdrawApplyLogProxy.class,
        power = @Power(add = false, edit = false, viewDetails = false, delete = false),
        rowOperation = {
                @RowOperation(
                        title = "提现申请",
                        icon = "fa fa-paypal",
                        mode = RowOperation.Mode.BUTTON,
                        eruptClass = WithdrawApplyVo.class,
                        operationHandler = WithdrawApplyHandler.class
                ),
        }

)
public class RentalPayWithdrawApplyLog extends BaseModel {

    @Transient
    @EruptField(
            views = @View(title = "余额类型"),
            edit = @Edit(
                    title = "余额类型",
                    type = EditType.CHOICE,
                    notNull = true,
                    search = @Search,
                    choiceType = @ChoiceType(
                            vl = {
                                    @VL(label = "资管", value = "2"),
                                    @VL(label = "融担", value = "3"),
                            }
                    ))
    )
    private Integer balanceType;


    @Transient
    @EruptField(
            views = @View(title = "金额", width = "150px"),
            edit = @Edit(title = "金额")
    )
    private BigDecimal number;

    @Transient
    @EruptField(
            views = @View(title = "状态"),
            edit = @Edit(
                    title = "状态",
                    type = EditType.CHOICE,
                    notNull = true,
                    search = @Search,
                    choiceType = @ChoiceType(
                            vl = {
                                    @VL(label = "待审核", value = "0"),
                                    @VL(label = "通过", value = "1"),
                                    @VL(label = "驳回", value = "2"),
                            }
                    ))
    )
    private Integer status;

    @Transient
    @EruptField(
            views = @View(title = "备注"),
            edit = @Edit(title = "备注")
    )
    private String remark;

    @Transient
    @EruptField(
            views = @View(title = "提现订单号"),
            edit = @Edit(title = "提现订单号")
    )
    private String orderNo;

    @Transient
    @EruptField(
            views = @View(title = "申请时间"),
            edit = @Edit(title = "申请时间",
                    notNull = true,
                    dateType = @DateType(type = DateType.Type.DATE_TIME))
    )
    private Date createTime;


    @Transient
    @EruptField(
            views = @View(title = "审核时间"),
            edit = @Edit(title = "审核时间",
                    notNull = true,
                    dateType = @DateType(type = DateType.Type.DATE_TIME))
    )
    private Date authTime;


}
